<?php include('../../include/functions.inc.php'); ?>
<div id="assignsdetail" style="width:80%;">
    <table class="table table-striped table-hover table-bordered" cellpadding="0" cellspacing="1">
        <tbody>
            <tr>
                <th >COD CURSO</th>
                <th >NOMBRE</th>
                <th >SECCION</th>
                <th >&nbsp;</th>
                <th >&nbsp;</th>
            </tr>  
            <?php
            $f = date('y-d-m');
            $where = "FK_ASSIGN=" . sqlValue(getParam("ID"), "int");
            $where.= " AND STATUS=1";

            $det = $db->query_select("cllg_assign_detail", $where, NULL);
            if (count($det) == 0) {
                ?>
                <tr >
                    <td colspan="5" >No tiene cursos asignados</td>
                </tr>
                <?php
            } else {
                $co = 1;
                foreach ($det as $c) {
                    $course = getCourseName($c["FK_COURSE"], $db);
                    $row = array("ID" => $c["ID"], "CURSO" => $course,
                        "FK_COURSE" => $c["FK_COURSE"],
                        "SECCION" => $c["SECTION"]);
                    $json_string = json_encode($row);
                    ?>
                    <tr class="<?php echo fmod($co, 2) == 0 ? 'data line0' : 'data line1'; ?>" >
                        <td><?php echo $row['FK_COURSE']; ?></td>
                        <td><?php echo $row['CURSO']; ?></td>
                        <td><?php echo $row['SECCION']; ?></td>
                        <td><a href="javascript:cancelCourse(<?php echo $row['ID']; ?>);" > Anular </a></td>
                        <td><a href="javascript:deleteCourse(<?php echo $row['ID']; ?>);" > Eliminar </a></td>
                    </tr> 
                    <?php
                    $co++;
                }
            }
            ?>

        </tbody>
    </table>
</div>